package com.example.day06;


import com.example.constract.UserStatus;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.type.TypeHandlerRegistry;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;

/**
 * @author jeff
 * @time 2023/4/30 22:19
 */
//@Configuration
//public class MybatisConfiguration implements ApplicationContextAware {
//
//
//    @Override
//    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//        //从spring容器获取sqlSessionFactory
//        SqlSessionFactory sqlSessionFactory = applicationContext.getBean(SqlSessionFactory.class);
//        //获取typeHandler注册器
//        TypeHandlerRegistry typeHandlerRegistry = sqlSessionFactory.getConfiguration().getTypeHandlerRegistry();
//        //注册List的typeHandler
//        typeHandlerRegistry.register(UserStatus.class, UserStatusEnumsTypeHandler.class);
//    }
//}
